<template>
  <div class="head">
    <div class="tit" @click="tab">
      <button id="1" :class="id==='1'?'active':''" class="tex1">操作装卸费报表</button>
      <button id="2" :class="id==='2'?'active':''" class="tex1">操作装卸费明细</button>
    </div>
    <div class="line" />
    <el-row>
      <el-col :span="24">
        <div v-if="id==='1'" class="title1">
          <el-form
            ref="form"
            style="display: flex;flex-wrap: wrap;margin-top: 24px;justify-content: space-between;"
            :model="form"
            label-width="80px"
          >
            <div style="display: flex;justify-content: space-between;flex-wrap: wrap;width: 1578px;">
              <el-form-item class="text" label="查询类型">
                <el-select class="input" placeholder="请选择" style="width: 286px;" @change="provinceChange">
                  <el-option
                    v-for="item in ProvinceList"
                    :key="item.id"
                    :label="item.province"
                    :value="{ pid: item.pid, province: item.province }"
                  />
                </el-select>
              </el-form-item>
              <el-form-item class="text" label="发车网点">
                <el-select class="input" placeholder="请选择" style="width: 286px;" @change="provinceChange">
                  <el-option
                    v-for="item in ProvinceList"
                    :key="item.id"
                    :label="item.province"
                    :value="{ pid: item.pid, province: item.province }"
                  />
                </el-select>
              </el-form-item>
              <el-form-item class="text" label="操作转运中心" label-width="100px">
                <el-select class="input" placeholder="输入关键字后自动搜索" style="width: 286px;" @change="provinceChange">
                  <el-option
                    v-for="item in ProvinceList"
                    :key="item.id"
                    :label="item.province"
                    :value="{ pid: item.pid, province: item.province }"
                  />
                </el-select>
              </el-form-item>
              <el-form-item class="text" label="装卸类型">
                <el-select class="input" placeholder="请选择" style="width: 286px;" @change="provinceChange">
                  <el-option
                    v-for="item in ProvinceList"
                    :key="item.id"
                    :label="item.province"
                    :value="{ pid: item.pid, province: item.province }"
                  />
                </el-select>
              </el-form-item>
            </div>
            <div>
              <el-form-item>
                <el-button type="primary" @click="onSubmit">查询</el-button>
                <el-button>重置</el-button>
              </el-form-item>
            </div>
          </el-form>
        </div>
        <div v-if="id==='1'" class="title1">
          <el-form
            ref="form"
            style="display: flex;justify-content: space-between;flex-wrap: wrap;"
            :model="form"
            label-width="80px"
          >
            <div style="display: flex;justify-content: space-between;flex-wrap: wrap;width: 1182px;">
              <el-form-item class="text" label="结算类型">
                <el-select placeholder="请选择" style="width: 286px;">
                  <el-option v-for="item in cityList" :key="item.id" class="input" :label="item.city" :value="item.city" />
                </el-select>
              </el-form-item>
              <el-form-item class="text" label="结算范围">
                <el-select placeholder="请选择" style="width: 286px;">
                  <el-option v-for="item in cityList" :key="item.id" class="input" :label="item.city" :value="item.city" />
                </el-select>
              </el-form-item>
              <el-form-item class="text" label="汇总层级" label-width="100px">
                <el-select placeholder="请选择" style="width: 286px;">
                  <el-option v-for="item in cityList" :key="item.id" class="input" :label="item.city" :value="item.city" />
                </el-select>
              </el-form-item>
            </div>
            <div>
              <el-form-item>
                <el-button @click="onSubmit"><i class="el-icon-upload2" />导出</el-button>
              </el-form-item>
            </div>
          </el-form>
        </div>
        <div v-if="id==='1'" class="title1">
          <el-form
            ref="form"
            style="display: flex;justify-content: space-between;flex-wrap: wrap;"
            :model="form"
            label-width="80px"
          >
            <div style="display: flex;justify-content: space-between;flex-wrap: wrap;width: 1174px;">
              <el-form-item class="text" label="日期">
                <el-date-picker
                  v-model="value"
                  type="daterange"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                  :default-time="['00:00:00', '23:59:59']"
                  style="width: 685px"
                />
              </el-form-item>
            </div>
          </el-form>
        </div>
        <el-table
          v-if="id==='1'"
          :data="tableData"
          border
          max-height="734"
          :header-cell-style="{ background: '#f6f6f6' }"
          style="width: 100%"
        >
          <el-table-column type="index" :index="table_index" width="50" align="center" />
          <el-table-column prop="name" label="结算时间段" width="180" align="center" />
          <el-table-column prop="address" label="发车网点编号" align="center" />
          <el-table-column prop="address" label="发车网点名称" align="center" />
          <el-table-column prop="name" label="操作中心编码" align="center" />
          <el-table-column prop="name" label="操作中心名称" align="center" />
          <el-table-column prop="name" label="装卸类型" align="center" />
          <el-table-column prop="name" label="结算类型" align="center" />
          <el-table-column prop="name" label="结算范围" align="center" />
          <el-table-column prop="name" label="进站重量/KG" align="center" />
        </el-table>

        <div v-if="id==='2'" class="kk" style="display: flex;flex-wrap: wrap;">
          <div class="title" style="display: flex;">
            <div style="margin-top: 40px;margin-right: 12px;">运单编号</div>
            <el-form ref="form" :model="form">
              <el-form-item class="text" label="">
                <el-input v-model="form.desc" rows="4" class="input" placeholder="一行表示一个运单号(支持1000个运单号)" type="textarea" />
              </el-form-item>
            </el-form>
          </div>
          <div style="margin-left: 40px;margin-top: 24px;">
            <div class="title1">
              <el-form ref="form" :rules="rules" style="display: flex;flex-wrap: wrap;justify-content: space-between;" :model="form" label-width="80px">
                <!-- <div style="display: flex;justify-content: space-between;flex-wrap: wrap;width: 1100px;"> -->
                <el-form-item class="text" label="查询维度">
                  <el-select v-model="form.region" class="input" style="width: 286px;" placeholder="请选择">
                    <el-option label="区域一" value="shanghai" />
                    <el-option label="区域二" value="beijing" />
                  </el-select>
                </el-form-item>
                <el-form-item class="text" label="费用类别">
                  <el-select v-model="form.region" class="input" placeholder="请选择">
                    <el-option label="区域一" value="shanghai" />
                    <el-option label="区域二" value="beijing" />
                  </el-select>
                </el-form-item>
                <el-form-item class="text" label="站点类型">
                  <el-select v-model="form.region" class="input" placeholder="请选择">
                    <el-option label="区域一" value="shanghai" />
                    <el-option label="区域二" value="beijing" />
                  </el-select>
                </el-form-item>
                <!-- </div> -->
                <div style="margin-left: 180px;">
                  <el-form-item>
                    <el-button type="primary" @click="onSubmit">查询</el-button>
                    <el-button>重置</el-button>
                  </el-form-item>
                </div>
              </el-form>
            </div>
            <div class="title1" style="margin-left: 40px;">
              <el-form ref="form" :rules="rules" style="display: flex;justify-content: space-between;flex-wrap: wrap;" label-width="40px" :model="form">
                <div style="display: flex;flex-wrap: wrap;justify-content: space-between;width: 1059px;">
                  <el-form-item class="text" label="日期">
                    <el-date-picker
                      v-model="value1"
                      class="input1"
                      type="daterange"
                      range-separator="至"
                      start-placeholder="开始日期"
                      end-placeholder="结束日期"
                      style="width: 653px;border: 1px #ccc solid;"
                    />
                  </el-form-item>
                  <el-form-item class="text" label="查询维度" label-width="80px">
                    <el-select v-model="form.region" class="input" style="width: 286px;" placeholder="请选择">
                      <el-option label="区域一" value="shanghai" />
                      <el-option label="区域二" value="beijing" />
                    </el-select>
                  </el-form-item>
                </div>
                <div>
                  <el-form-item>
                    <el-button @click="onSubmit"><i class="el-icon-upload2" />导出</el-button>
                    <el-button @click="onSubmit"><i class="el-icon-c-scale-to-original" />说明</el-button>
                  </el-form-item>
                </div>
              </el-form>
            </div>
          </div>
        </div>
        <el-table
          v-if="id==='2'"
          :data="tableData"
          border
          max-height="734"
          :header-cell-style="{ background: '#f6f6f6' }"
          style="width: 100%"
        >
          <el-table-column type="index" :index="table_index" width="50" align="center" />
          <el-table-column prop="name" label="结算日期" width="180" align="center" />
          <el-table-column prop="address" label="任务号" align="center" />
          <el-table-column prop="address" label="发车网点编码" width="110" align="center" />
          <el-table-column prop="name" label="发车网点名称" width="110" align="center" />
          <el-table-column prop="name" label="操作转运中心编码" width="140" align="center" />
          <el-table-column prop="name" label="操作转运中心名称" width="140" align="center" />
          <el-table-column prop="name" label="车牌号" align="center" />
          <el-table-column prop="name" label="车辆类型" align="center" />
          <el-table-column prop="name" label="结算范围" align="center" />
          <el-table-column prop="name" label="装卸类型" align="center" />
          <el-table-column prop="name" label="车辆尺寸/米" width="100" align="center" />
          <el-table-column prop="name" label="称重时间/入库" width="110" align="center" />
          <el-table-column prop="name" label="入站重量-毛重/KG" width="140" align="center" />
          <el-table-column prop="name" label="出站重量/KG" width="110" align="center" />
          <el-table-column prop="name" label="皮重/KG" align="center" />
          <el-table-column prop="name" label="整车结算重量/KG" width="140" align="center" />
          <el-table-column prop="name" label="结算金额" align="center" />
        </el-table>
        <div style="display: flex;justify-content: space-between;margin-top: 51px;">
          <div class="title2">显示2到2，共2记录</div>
          <div class="block" style="display: flex; justify-content: end">
            <el-pagination
              background
              :current-page="currentPage4"
              :page-sizes="[10, 20, 30, 40]"
              :page-size="10"
              layout="prev, pager, next,sizes"
              :total="khTotal"
              prev-text="上一页"
              next-text="下一页"
              @size-change="khHandleSizeChange"
              @current-change="khHandleCurrentChange"
            />
          </div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>

export default {

  components: {},
  data() {
    return {
      id: '1',
      ProvinceList: [], // 省
      cityList: [], // 市
      value: '',
      page: 1,
      pageSize: 10,
      form: {
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      },
      mxForm: {
        destinationProvince: '',
        destinationCity: ''
      },
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }]
    }
  },

  computed: {},

  created() {

  },

  methods: {
    tab(e) {
      if (e.target.id !== '') {
        this.id = e.target.id
      }
    },
    // 序号
    table_index(index) {
      return (this.page - 1) * this.pageSize + index + 1
    }
  }
}

</script>
<style  scoped lang="scss">
.kk{
  .title{
  .input{
    width: 286px;
// height: 88px;
background: #FFFFFF;
border: 1px solid #B4B4B4;
border-radius: 4px;
  }
}
.head{
  padding: 30px;
}
.title{
  font-size: 16px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
}
}
.tit {
  display: flex;
  .tex1 {
    margin-right: 48px;
    font-size: 16px;
    font-family: Source Han Sans CN;
    font-weight: 400;
    color: #666666;
    background: #fff;
    border: 1px #fff solid;
  }

  .active {
    font-family: Source Han Sans CN;
    font-weight: 700;
    color: #2087D0;
    position: relative;

  }

  .active::before {
    position: absolute;
    content: '';
    width: 110px;
    height: 2px;
    background: #2087D0;
    border-radius: 1px;
    bottom: -20px;
    left: 50%;
    transform: translate(-50%);
  }
}

.head {
  padding: 30px;
}

.title {
  font-size: 16px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: #666666;
  margin-top: 20px;
}

.line {
  height: 1px;
  background: #D8D8D8;
  border-radius: 1px;
  margin-top: 19px;
}

.title1 {
   .text {
    font-size: 18px;
    font-family: Source Han Sans CN;
    font-weight: 400;
    color: #666666;

    .input {
      width: 286px;
      height: 36px;
      background: #FFFFFF;
      border-radius: 4px;
    }

    .input1 {
      width: 708px;
      height: 36px;
      background: #FFFFFF;
      border: 1px solid #B4B4B4;
      border-radius: 4px;
    }
  }
}

.title2 {
  font-size: 18px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: #666666;
}
</style>
